Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> h1 { border-bottom: 3px solid #cc9900; color: #996600; font-size: 30px; } table, th , td { border: 1px solid grey; border-collapse: collapse; padding: 5px; } table tr:nth-child(odd) { background-color: #f1f1f1; } table tr:nth-child(even) { background-color: #ffffff; } </style> </head> <body> <h1>Customers</h1> <div id="id01"></div> <script> var xmlhttp = new XMLHttpRequest(); var url = "../website/Customers_MYSQL-2.html"; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { myFunction(xmlhttp.responseText); } } xmlhttp.open("GET.html", url, true); xmlhttp.send(); function myFunction(response) { var arr = JSON.parse(response); var i; var out = "<table>"; for(i = 0; i < arr.length; i++) { out += "<tr><td>" + arr[i].Name + "</td><td>" + arr[i].City + "</td><td>" + arr[i].Country + "</td></tr>"; } out += "</table>" document.getElementById("id01").innerHTML = out; } </script> </body> <!-- Mirrored from www.w3schools.com/json/tryit.asp?filename=tryjson_server_sql_style by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:41:01 GMT --> </html>
Result:
Try it Yourself - © w3schools.com